import re

# Sample text from get_text action (showing only beginning and end)
text = '''百度首页设置登录\n\u16a0\n网页图片资讯视频笔记地图贴吧文库更多\n...\n帮助举报用户反馈企业推广'''

# Regular expressions for extracting stock prices and dates
price_patterns = [
    r"(\d{1,3}(?:[.,]\d{3})*(?:\.\d{2})?)\s*[-+]?\d*\.?\d*%?",  # Matches prices with optional change percentages
    r"(\d{1,3}(?:[.,]\d{3})*(?:\.\d{2})?)\s*[港元美元]"       # Matches prices followed by currency symbols
]
date_patterns = [
    r"(\d{4}[\/-]\d{1,2}[\/-]\d{1,2})",   # YYYY-MM-DD or YYYY/MM/DD
    r"(\d{1,2}[\/-]\d{1,2})",              # MM-DD or MM/DD
    r"(今天|昨天|前天|\d{1,2}\s*(?:分钟|小时)前)" # Relative dates/times
]

# Extract potential stock prices
def extract_prices(text):
    prices = []
    for pattern in price_patterns:
        prices += re.findall(pattern, text)
    return [float(p.replace(',', '')) for p in prices]

# Extract potential dates
def extract_dates(text):
    dates = []
    for pattern in date_patterns:
        dates += re.findall(pattern, text)
    return dates

# Get unique prices and dates
prices = list(set(extract_prices(text)))
dates = list(set(extract_dates(text)))

prices, dates